package com.oms.service;

import com.oms.domain.User;
import com.oms.web.form.RegisteForm;


public interface UserService extends BaseService<User> {
	
	//通过邮箱查找用户
	public User findUserByEmail(String email);
	
	//通过用户名查找用户
	public User findUserByName(String name);
	
	//注册用户
	public Boolean registeUser(RegisteForm registeForm);
	
	//用户激活
	public User activeUser(String activeCode);

	//使用邮箱、密码登录用户
	public User loginByEmail(String email, String password);
	
	//邮箱重置密码
	public void forgotPasswordByEmail(String email);
	
	//用户通过邮箱重置密码
	public User applyResetPawByEmail(String resetCode);
	
	/**
	 * 重设拥有该重置码的用户密码
	 * @param resetCode	重置码，对应表的activeCode
	 * @param password	新密码
	 * @return	该用户
	 */
	public User resetPassword(String resetCode,String password);

	//通过主键查找用户
	public User findUserById(Integer id);
	
	/**
	 * 
	 * @param user
	 */
	public void updateUser(User user);

}
